﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace OP20.ViewModels
{

    public class ContinuousNgViewModel : BaseViewModel
    {
        public ContinuousNgViewModel(IRegionManager regionManager) : base(regionManager)
        {
            InitParam();
        }

        private void InitParam()
        {
            NgCountSet01 = ContinuousNGCount_GLobal.nParaData0;
            NgCountSet02 = ContinuousNGCount_GLobal.nParaData1;
            NgCountSet03 = ContinuousNGCount_GLobal.nParaData2;
            NgCountSet04 = ContinuousNGCount_GLobal.nParaData3;
            NgCountSet05 = ContinuousNGCount_GLobal.nParaData4;
            NgCountSet06 = ContinuousNGCount_GLobal.nParaData5;
            NgCountSet07 = ContinuousNGCount_GLobal.nParaData6;
            NgCountSet08 = ContinuousNGCount_GLobal.nParaData7;
            NgCountSet09 = ContinuousNGCount_GLobal.nParaData8;
            NgCountSet10 = ContinuousNGCount_GLobal.nParaData9;

        }


        #region 事件

        private DelegateCommand<string> _TextChangeCommand;
        public DelegateCommand<string> TextChangeCommand =>
            _TextChangeCommand ?? (_TextChangeCommand = new DelegateCommand<string>(ExecuteTextChangeCommand));

        void ExecuteTextChangeCommand(string p)
        {
            switch (p)
            {

                case "NgCountSet01":
                    ContinuousNGCount_GLobal.nParaData0 = NgCountSet01;
                    break;
                case "NgCountSet02":
                    ContinuousNGCount_GLobal.nParaData1 = NgCountSet02;
                    break;
                case "NgCountSet03":
                    ContinuousNGCount_GLobal.nParaData2 = NgCountSet03;
                    break;
                case "NgCountSet04":
                    ContinuousNGCount_GLobal.nParaData3 = NgCountSet04;
                    break;
                case "NgCountSet05":
                    ContinuousNGCount_GLobal.nParaData4 = NgCountSet05;
                    break;
                case "NgCountSet06":
                    ContinuousNGCount_GLobal.nParaData5 = NgCountSet06;
                    break;
                case "NgCountSet07":
                    ContinuousNGCount_GLobal.nParaData6 = NgCountSet07;
                    break;
                case "NgCountSet08":
                    ContinuousNGCount_GLobal.nParaData7 = NgCountSet08;
                    break;
                case "NgCountSet09":
                    ContinuousNGCount_GLobal.nParaData8 = NgCountSet09;
                    break;
                case "NgCountSet10":
                    ContinuousNGCount_GLobal.nParaData9= NgCountSet10;
                    break;
                default:
                    break;
            }
        }
        #endregion

        #region  属性连续NG设定值
        private uint _NgCountSet01;
        public uint NgCountSet01
        {
            get { return _NgCountSet01; }
            set { SetProperty(ref _NgCountSet01, value); }
        }

        private uint _NgCountSet02;
        public uint NgCountSet02
        {
            get { return _NgCountSet02; }
            set { SetProperty(ref _NgCountSet02, value); }
        }


        private uint _NgCountSet03;
        public uint NgCountSet03
        {
            get { return _NgCountSet03; }
            set { SetProperty(ref _NgCountSet03, value); }
        }

        private uint _NgCountSet04;
        public uint NgCountSet04
        {
            get { return _NgCountSet04; }
            set { SetProperty(ref _NgCountSet04, value); }
        }

        private uint _NgCountSet05;
        public uint NgCountSet05
        {
            get { return _NgCountSet05; }
            set { SetProperty(ref _NgCountSet05, value); }
        }

        private uint _NgCountSet06;
        public uint NgCountSet06
        {
            get { return _NgCountSet06; }
            set { SetProperty(ref _NgCountSet06, value); }
        }

        private uint _NgCountSet07;
        public uint NgCountSet07
        {
            get { return _NgCountSet07; }
            set { SetProperty(ref _NgCountSet07, value); }
        }

        private uint _NgCountSet08;
        public uint NgCountSet08
        {
            get { return _NgCountSet08; }
            set { SetProperty(ref _NgCountSet08, value); }
        }

        private uint _NgCountSet09;
        public uint NgCountSet09
        {
            get { return _NgCountSet09; }
            set { SetProperty(ref _NgCountSet09, value); }
        }

        private uint _NgCountSet10;
        public uint NgCountSet10
        {
            get { return _NgCountSet10; }
            set { SetProperty(ref _NgCountSet10, value); }
        }
        #endregion
    }
}

